<!DOCTYPE html>
<html xmlns:th="www.thymeleaf.org">
<head th:replace="admin::head"></head>
<title>修改信息 - 管理员中心 - 双辞动漫-专注二次元动漫的小站</title>
<meta name="keywords" content="修改信息 - 管理员中心">
<meta name="description" content="修改信息 - 管理员中心">
<link rel="stylesheet" type="text/css" href="css/admin_info.css">
<script type="text/javascript" src="/template/conch/asset/js/set/formValidator.js"></script>
<script type="text/javascript" src="/static/js/jquery.imageupload.js"></script>
<script type="text/javascript">
    var maccms={"path":"","mid":"6","url":"www.scdmfun.cn","wapurl":"www.cdmfun.cn","mob_status":"0"};
    var conchtpl={"surl":"/search.html","tipt":"网站公告","tipc":"这里是双辞动漫新站<br><span class='hl-text-conch'>注意事项：</span>1.老站新老站账号不通用<br>老站网址：<span class='hl-text-conch'>dm.scdmfun.cn</span><br>2.如果登录后还是提示未登录请稍等一会再刷新即可<br>动漫闲聊群：<span class='hl-text-conch'>542266218</span>","slink":"https://www.scdmfun.cn/","short":"","api":"0","tok":"","term":"long-term","ver":"3.1"}
</script>
<body id="conch-member">
<!--海螺影视主题  https://www.360mb.net/23977.html-->
<div th:replace="admin::.conch-header"></div>
<div class="conch-header">
    <div class="conch-headwrap conch-hasone conch-hasconch hl-hide-sm">
        <div class="hl-mob-nav">
            <a href="javascript:MAC.GoBack()" class="hl-pull-left left"><i class="iconfont hl-icon-jiantouzuo"></i></a>
            <a href="javascript:void(0)" class="hl-pull-right right"></a>
            <span class="hl-mob-title hl-text-site hl-lc-1">修改信息</span>
        </div>
    </div>
</div>
<div class="conch-content conch-member">
    <div class="conch-ctwrap">
        <div class="hl-ctwrap-item">
            <div class="container">
                <div class="hl-row-box clearfix">
                    <div class="row">
                        <div th:replace="admin::#left"></div>
                        <div id="right" class="hl-right-content hl-col-xs-12 hl-col-sm-70w hl-col-lg-9">
                            <div class="hl-cont-right">
                                <div class="hl-rb-head hl-hidden-xs clearfix">
                                    <h2 class="hl-rb-title">我的资料</h2>
                                </div>
                                <div class="hl-cont-tab">
                                    <div class="hl-rb-head hl-head-page clearfix">
                                        <div th:replace="admin::#admin_common"></div>
                                    </div>
                                    <div class="hl-cont-list">
                                        <div class="hl-list-wrap">
                                            <form id="fm" name="fm" method="post" action="">
                                                <p><span>原始密码</span><input type="password" name="user_pwd"
                                                                           placeholder="请输入原始密码" v-model="opwd"></p>
                                                <p><span>新密码</span><input type="password" name="user_pwd1"
                                                                          placeholder="请输入新密码" v-model="newpwd"></p>
                                                <p><span>重复密码</span><input type="password" name="user_pwd2"
                                                                           placeholder="请重复新密码" v-model="renewpwd"></p>
                                                <input type="button" class="hl-btn-submit hl-bg-conch"
                                                       value="保存" @click="commit">
                                                <div class="hl-tip-text"><a href="/index.php/user/findpass.html">忘记密码了？找回密码</a>
                                                </div>
                                            </form>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!--海螺影视主题  https://www.360mb.net/23977.html-->
<div th:replace="admin::.conch-footer"></div>
<script type="text/javascript">
    var json='[[${admin}]]';
    json=json.replace(/&quot;/g,'"');
    let a=new Vue({
        el: "#right",
        data: {
            admin: JSON.parse(json),
            opwd: '',
            newpwd: '',
            renewpwd: '',
            curPage: 'admin_updatepwd'
        },
        methods: {
            commit(){
                if (this.renewpwd!=''&&this.newpwd!=''&&this.newpwd!=this.renewpwd){
                    alert("两次密码不一样，请确认后重试");
                    return;
                }
                this.admin.password=this.opwd;
                var str=JSON.stringify(this.admin);
                var url="admin_updatepwd.do";
                var params=new URLSearchParams();
                params.append("admin",str);
                params.append("newpwd",this.newpwd);
                axios.post(url, params).then(res=>{
                    var data=res.data;
                    alert(data.msg);
                });
            },
            queryAdmin() {
                let url = "/CheckLoginAdmin.do";
                let params = new URLSearchParams();
                axios.post(url, params).then(res => {
                    var data = res.data;
                    if (data.code == 1) {
                        this.admin = data.data;
                        this.admin.password='';
                    }
                });
            },
        },
        beforeMount() {
            this.queryAdmin();
        }
    })
</script>
</body>
</html>